#include "UbusEvent.h"

class MsgRecv : public IMessageReceiver
{
    void onReceive(const std::string &message)
    {
        std::cout << "message..." << message << std::endl;
    }
};

int main(int argc, char *argv[])
{
    MsgRecv msgrecv;
    std::shared_ptr<UbusEvent> bus = std::make_shared<UbusEvent>();

    // bus->SendMsg("add_device", "{\"major\":5,\"minor\":22,\"name\":\"mmc01\"}");
    bus->Subscribe("add_device", &msgrecv);
    bus->Subscribe("add_device1", &msgrecv);

    std::cout << "Leaving..." << std::endl;
    // bus->unSubscribe("add_device", &msgrecv);

    while (1)
        ;
    return 0;
}
